import type { FormSchemaGetter } from '#/adapter/form';
import type { VxeGridProps } from '#/adapter/vxe-table';

import { DictEnum } from '@vben/constants';
// import { VbenIcon } from '@vben/icons';
import { getPopupContainer } from '@vben/utils';
// import { SensitiveText } from '#/components/text';

// import { Tag } from 'ant-design-vue';
// import { z } from '#/adapter/form';
import { getDictOptions } from '#/utils/dict';
// import { renderDict } from '#/utils/render';

export const querySchema: FormSchemaGetter = () => [
  {
    component: 'GroupSearchSelect',
    fieldName: 'groupId',
    label: '团体名称',
  },
  {
    component: 'Select',
    fieldName: 'readStatus',
    componentProps: {
      getPopupContainer,
      options: getDictOptions(DictEnum.READ_STATUS, true),
    },
    label: '状态',
  },
];

export const columns: VxeGridProps['columns'] = [
  { type: 'checkbox', width: 60 },
  {
    title: '团体名称',
    field: 'groupName',
    width: 320,
  },
  {
    title: '主联系人',
    field: 'masterName',
    width: 110,
  },
  {
    title: '主联系人电话',
    field: 'masterMobile',
    width: 160,
    slots: {
      default: ({ row }) => {
        return (
          <span>{row.masterMobile}</span>
          // <SensitiveText
          //   access-page={1}
          //   employee-id={row.id}
          //   text={row.masterMobile}
          //   type={1}
          // />
        );
      },
    },
  },
  {
    title: '总人数',
    field: 'totalCount',
    width: 110,
  },
  {
    title: '变更内容',
    field: 'content',
    minWidth: 400,
    showOverflow: false,
  },
  {
    title: '创建时间',
    field: 'createTime',
    width: 170,
  },
  {
    field: 'action',
    fixed: 'right',
    slots: { default: 'action' },
    title: '操作',
    width: 160,
  },
];
